gl: Reset GL_UNPACK_ALIGNMENT
authorMatthias Clasen <mclasen@redhat.com>
Fri, 25 Sep 2020 20:17:45 +0000 (16:17 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 25 Sep 2020 20:17:45 +0000 (16:17 -0400)
Reset GL_UNPACK_ALIGNMENT to its initial value of 4 after
changing it for a glTexImage2D call.

gdk/gdkglcontext.c

index 5614b2ce47491e65c0fde743005de36843b487e2..7f544dc00395e091a9a7fca4db9f1f15d246454f 100644 (file)
@@ -294,6 +294,7 @@ gdk_gl_context_upload_texture (GdkGLContext    *context,
       glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
 
       glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, gl_format, gl_type, data);
+      glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
     }
   else if ((!priv->use_es ||
             (priv->use_es && (priv->gl_version >= 30 || priv->has_unpack_subimage))))
@@ -304,6 +305,7 @@ gdk_gl_context_upload_texture (GdkGLContext    *context,
       glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, gl_format, gl_type, data);
 
       glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
+      glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
     }
   else
     {